package com.jader.beans;

import java.io.Serializable;

public class Goods implements Serializable {
private Seller seller;
	private static final long serialVersionUID = 1L;
	
	// 商品ID
	private int goodsid;
	// 店铺id
	private int sellerid;
	// 商品名称
	private String goodsName;
	// 商品价格
	private double price;
	// 商品描述
	private String desc;
	// 商品分类
	private String category;
	// 商品图片
	private String picture;
	// 库存
	private int stock;
	// 销量
	private int number;

	public Goods(Seller seller,int goodsid, int sellerid, String goodsName, double price,
			String desc, String category, String picture, int stock, int number) {
		super();
		this.seller=seller;
		this.goodsid = goodsid;
		this.sellerid = sellerid;
		this.goodsName = goodsName;
		this.price = price;
		this.desc = desc;
		this.category = category;
		this.picture = picture;
		this.stock = stock;
		this.number = number;
	}

	public Seller getSeller() {
		return seller;
	}

	public void setSeller(Seller seller) {
		this.seller = seller;
	}

	public int getGoodsid() {
		return goodsid;
	}

	public void setGoodsid(int goodsid) {
		this.goodsid = goodsid;
	}

	public int getSellerid() {
		return sellerid;
	}

	public void setSellerid(int sellerid) {
		this.sellerid = sellerid;
	}

	public String getGoodsName() {
		return goodsName;
	}

	public void setGoodsName(String goodsName) {
		this.goodsName = goodsName;
	}

	public double getPrice() {
		return price;
	}

	public void setPrice(double price) {
		this.price = price;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	public String getCategory() {
		return category;
	}

	public void setCategory(String category) {
		this.category = category;
	}

	public String getPicture() {
		return picture;
	}

	public void setPicture(String picture) {
		this.picture = picture;
	}

	public int getStock() {
		return stock;
	}

	public void setStock(int stock) {
		this.stock = stock;
	}

	public int getNumber() {
		return number;
	}

	public void setNumber(int number) {
		this.number = number;
	}

	@Override
	public String toString() {
		return "Goods [goodsid=" + goodsid + ", sellerid=" + sellerid
				+ ", goodsName=" + goodsName + ", price=" + price + ", desc="
				+ desc + ", category=" + category + ", picture=" + picture
				+ ", stock=" + stock + ", number=" + number + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + goodsid;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Goods other = (Goods) obj;
		if (goodsid != other.goodsid)
			return false;
		return true;
	}

}
